<?
// ===================================================
// Students Mail
// 8.0.0.0
// ===================================================

// ========================================================================================================
function userInfo($users=0) {
	global $_SESSION, $smarty;

	if (!$users) {
		if ($_SESSION[S_UID])	$users = getUsersTable($_SESSION[S_UID]);
		else 					return false;
	}

	$smarty->assign('aBlogs', 	"<a href='/blogs/users/".$users[login]."/'>");
	$smarty->assign('aInfo', 	javaLink("/visa/?uid=$users[uid]", "visa_".$mess[uid], 805, 560, "no", "no"));
	$smarty->assign('aPhoto', 	"<a href='/photo/users/".$users[login]."/'>");

	$smarty->assign('aAdd', 	"<a href='/photo/add/'>");
	$smarty->assign('aDel', 	javaLink("/photo/delete/?photoId=".$users[pid],	"Image_".$users[pid], 280, 280));

	$smarty->assign('aPh', 		javaLink("/flirt/image/".$login."/?uid=".$users[uid], "photo_".$users[uid], 455, 620));
	$smarty->assign('aTop', 	javaLink("/flirt/top100/show/?uid=".$users[uid], "top", 545, 630));
	$smarty->assign('tagsMark',	javaLink("/flirt/top100/marks/?uid=".$users[uid], 		"marks", 545, 630, "yes"));

	$smarty->assign('photoShow',photoShow($users[pid], "m", $users[moder], 1, "border_gray"));

	$smarty->assign('bMemo', intval($users[blogsCount] / 100000));
	$smarty->assign('bComm', intval($users[blogsCount] % 100000));
	$smarty->assign('pMemo', intval($users[photoCount] / 100000));
	$smarty->assign('pComm', intval($users[photoCount] % 100000));

	$smarty->assign('owner', checkOwner($users[uid]) OR checkPrivAdmin());
	$smarty->assign('photo', $users[status] & 16);

	return $smarty->fetch('user.info.tpl');
}

// ========================================================================================================
function usersRowForum() {
	global $ROOT, $smarty;

	$result = getResults("fHot, fTopic", "fTopic.tid=fHot.tid AND fTopic.statusT < 64 ORDER BY hid DESC LIMIT 0,2");

	while ($hotForum = fetchArray($result)) {
		$tagForum = "<a href='/forum/message/?topic=$hotForum[tid]'>";
		$name[]  = $tagForum.substr(nickStr($hotForum[title]), 0, 26);

	}

	$smarty->assign('name', $name);
	return $smarty->fetch('forum.row.tpl');
}

// ========================================================================================================
function mainPageBlog($gender="F") {
	$where_add = "userLogin.gender='".$gender."' AND blogs.uid=userLogin.uid";
	$order_add = " ORDER BY mid DESC";
	$result = getOneRow("blogs, userLogin", $where_add.$order_add);

	blogReply($result, 1);
}

?>
